<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vertical</title>
    <script type="text/javascript" src="/static/js/vue.min.js"></script>
</head>
    <style>
        .vertical{
            height: 30px;
            font-size: 13px;
            overflow: hidden;
        }
        [v-cloak]{
            visibility: hidden !important; /*防止被覆盖*/
        }
    </style>
<body>

    <div class="vertical" v-cloak></div>


    <script src="/static/js/scroxt.min.js"></script>
    <script>
        let verticalVue = new Vue({
            el : ".vertical",
            data : {
                popupMap : {},  //弹幕事件数组
                scroxtVertical : null,//弹幕滑动对象
            },
            methods : {
                addPopup : function(msg) {
                    this.scroxtVertical.addBarrage(msg)
                },
            },
            mounted : function () {
                let that = this;
                setTimeout(()=>{
                    that.scroxtVertical = new scroxt.Live({target: ".vertical"});
                    window.parent.Bus.$on("addPopup",(data)=>{
                        that.addPopup(data);
                    })
                    window.parent.Bus.$on("cleanPopUp",(data)=>{
                        that.popupMap = {};
                    })
                },1000)
            }
        })

    </script>

</body>
</html>